<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <!-- 
            Replace path to template, title, header and body
            with actual data.
    -->
    <ui:composition template="/templates/template.xhtml">
        <ui:define name="pageTitle">Alterar Funcionário</ui:define>
        <ui:define name="titleBody">Alterar Funcionário</ui:define>
        <ui:define name="body">
            <h:panelGroup styleClass="painel">
                <h:message for="formulario"/>
                <h:form id="formulario">
                    <table style="margin: auto; text-align: left;" id="estiloTexto">
                        <tr>
                            <td>
                                <h:outputText value="Nome:" />
                            </td>
                            <td>
                                <h:inputText id="idNome" value="#{funcionarioCtrl.funcionario.nome}" style="margin-left: 25px;" maxlength="40" required="true" ></h:inputText>
                                <h:message for="idNome"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="CPF:" />
                            </td>
                            <td>
                                <h:inputText id="idCpf" value="#{funcionarioCtrl.funcionario.cpf}" style="margin-left: 25px;" maxlength="11" required="true">
                                    <f:validator validatorId="CPFValidator" />
                                </h:inputText>
                                <h:message for="idCpf"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="RG:" />
                            </td>
                            <td>
                                <h:inputText id="idRg" value="#{funcionarioCtrl.funcionario.rg}" style="margin-left: 25px;" maxlength="25" required="true"></h:inputText>
                                <h:message for="idRg"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="Data de Nascimento" />
                            </td>
                            <td>
                                <h:inputText id="idDataNascimento" value="#{funcionarioCtrl.funcionario.dataNascimento}" style="margin-left: 25px;" maxlength="10" required="true" converterMessage="Exemplo: 21/03/2007">
                                    <f:convertDateTime pattern="dd/MM/yyyy"/>                                   
                                </h:inputText>
                                <h:message for="idDataNascimento"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="Telefone:" />
                            </td>
                            <td>
                                <h:inputText id="idTelefone" value="#{funcionarioCtrl.funcionario.telefone}" style="margin-left: 25px;" maxlength="14"></h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="Email:" />
                            </td>
                            <td>
                                <h:inputText id="idEmail" value="#{funcionarioCtrl.funcionario.email}" style="margin-left: 25px;" maxlength="30">
                                    <f:validator id="idEmailValidator" validatorId="EmailValidator"/>
                                </h:inputText>
                                <h:message for="idEmail"/>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="Endereço:" />
                            </td>
                            <td>
                                <h:inputText id="idEndereco" value="#{funcionarioCtrl.funcionario.endereco}" style="margin-left: 25px;" maxlength="25" required="true"></h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="CTPS" />
                            </td>
                            <td>
                                <h:inputText id="idCtps" value="#{funcionarioCtrl.funcionario.ctps}" style="margin-left: 25px;" maxlength="25" required="true"></h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="LOGIN" />
                            </td>
                            <td>
                                <h:inputText id="Login" value="#{funcionarioCtrl.funcionario.login}" style="margin-left: 25px;" maxlength="25" required="true"></h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h:outputText value="SENHA" />
                            </td>
                            <td>
                                <h:inputText id="idSenha" value="#{funcionarioCtrl.funcionario.senha}" style="margin-left: 25px;" maxlength="25" required="true"></h:inputText>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <h:commandButton value="Alterar"  actionListener="#{funcionarioCtrl.alterarFuncionario()}"></h:commandButton>
                            </td>
                        </tr>
                    </table>
                </h:form>
                <a href="listarFuncionario.xhtml" style="margin-left: 25px; margin-top: -35px;"> Listar funcionarios</a>
                <br /><br /><br /><br /><br /><br /><br />
                <br /><br /><br /><br /><br /><br /><br />
                <br />
            </h:panelGroup>
        </ui:define>
    </ui:composition>

</html>